tg-me.com/python_codes/7
Last Update:
4. String Basics
>>> s='python_codes'
>>> s
'python_codes'
>>> len(s)
12
>>> s[0]
'p'
>>> s[1:]
'ython_codes'
>>> s
'python_codes'
>>> s[:7]
'python_'
>>> s[:]
'python_codes'
>>> s[::1]
'python_codes'
>>> s[::-1]
'sedoc_nohtyp'
>>> var = "a"
>>> var*10
'aaaaaaaaaa'
>>> s=s+" python channel"
>>> s
'python_codes python channel'
>>> s.upper()
'PYTHON_CODES PYTHON CHANNEL'
>>> s.lower()
'python_codes python channel'
>>> s.split('codes')
['python_', ' python channel']
@python_codes
BY Python Codes
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/python_codes/7